1. Field
Embodiments relate to methods and apparatuses for converting a program, and more particularly, to methods and apparatuses for converting a program, which may enhance an execution speed of a computer program.
2. Description of the Related Art
A computer program may be written in a programming language. The computer program may be written in a programming language. Generally, a computer program may be written in a high level language such as C language by a programmer. In order for a computer program, which is written in a high level language, to be executed in a program execution device such as a computer, the computer program may need to be converted into a low level language which may be directly understood by the computer.
The program execution device may include a processing unit. The processing unit may be one of a central processing unit (CPU), a graphics processing unit (GPU), a micro controller unit (MCU), and another similar processing unit.
The processing units may understand and execute instructions included in a specific instruction set. Hence, a computer program, which is written in a high level language, needs to be converted into a computer program which is composed of the above instructions. The program, which performs the above conversion, is generally called a compiler.
Furthermore, even if the same computer program is used, the complied result, i.e., the complied program, may be different depending on which complier has been used for conversion. Programs, which perform the same function, may have different program lengths and may include different numbers commands.
Generally, a program with a shorter execution time is considered as a superior program among one or more converted programs which perform the same function. Hence, a compiler, which may convert a computer program into a program with the shortest execution time, may be considered as the best computer program.
Furthermore, the process of converting a computer program, which is written in a high level language, into a computer program of a low level language, may include one or more operations. For example, a computer program, which is written in a high level language, may be converted into another computer program, which is written in a high level language, at least once. Furthermore, the converted computer program may be converted into a computer program, which is written in an intermediate level language, at least once. Furthermore, the converted computer program may be converted into a computer program, which is written in a low level language, at least once.
Likewise, a computer program, which is written in a high level language, may be converted into an optimized computer program with a shortest execution time by performance of one or more operations as described above.